package com.zw.a.basic.a13.demo05_tickets_runnable;

//案例: 模拟卖票_实现Runnable接口版.
/*
    Thread类中的构造方法和成员方法:
        构造方法:
            public Thread(Runnable target, String name);

 */
public class Demo {
    public static void main(String[] args) {
        //1. 创建线程.
        //1.1 创建资源对象
        MyRunnable mr = new MyRunnable();
        //1.2 创建线程对象.
        Thread t1 = new Thread(mr, "窗口1");
        Thread t2 = new Thread(mr, "窗口2");
        Thread t3 = new Thread(mr, "窗口3");
        Thread t4 = new Thread(mr, "窗口4");

        //2. 开启线程.
        t1.start();
        t2.start();
        t3.start();
        t4.start();
    }
}
